package com.suse.configdemo.controller;


import jakarta.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/yml")
public class YmlController {

    @Value("${myKey}")
    private String myKey;

    @Value("${server.port}")
    private Integer serverPort;

    @Value("${string.str1}")
    private String str1;
    @Value("${string.str2}")
    private String str2;
    @Value("${string.str3}")
    private String str3;

    @PostConstruct
    public void readValue() {
        System.out.println("=====================");
        System.out.println(myKey);
        System.out.println(serverPort);

        System.out.println(str1);
        System.out.println(str2);
        System.out.println(str3);
    }
}
